'use strict'

exports.reply = function *(next){
	var message = this.weixin;
	if (message.msgType == 'event') {
		if (message.Event == 'subscribe') {
			if (message.EventKey) {
				console.log('扫二维码进来：'+message.EventKey +''+message.ticket);
			}
			this.body = '哈哈，你订阅了这个号：'+ message.MsgId;
		}else if(message.Event == 'unsubscribe'){
			console.log('无情取消关注');
		}

	}else{
		this.body = "您好，我现在不在，你发送的‘"+message.Content+"’,我将尽快发送给主人"
	}
	yield next;
}